public class sxh {
    public static void main(String[] args) {
        int max=0;
        for (int i=100;i<=999;i++){
            int i1=i/100;
            int i2=i%100;
            int i3=i2/10;
            int i4=i2%10;
            if ((i1*i1*i1+i3*i3*i3+i4*i4*i4)==i){
                max=i;

            }System.out.println(max);
        }
    }
}
